package com.itown.expo.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.web.servlet.ModelAndView;

import webframe.common.helper.ControllerHelper;

import com.itown.expo.controller.base.MyBaseCommandController;
import com.itown.expo.model.CcyRate;

public class CcyRateListController extends MyBaseCommandController {

	@Override
	protected ModelAndView handleInner(HttpServletRequest request,
			HttpServletResponse response, Object command) {
		CcyRate ccyRate = (CcyRate) command;
		DetachedCriteria criteria = DetachedCriteria.forClass(CcyRate.class);

		ControllerHelper.addEqualRestrictions(criteria, "id", ccyRate.getId());
		ControllerHelper.addLikeRestrictions(criteria, "ccyName", ccyRate
				.getCcyName());

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("page", ControllerHelper.queryPagination(request, criteria));
		return new ModelAndView("CcyRateList.jsp", "map", map);
	}

}
